package com.starleague.battletech.unit;

public class WeightUtil
{
    // private static final double PRECISION = 0.000001;
    private static final double ROUND_PRECISION = 0.499999;

    public static IWeight roundUp(IWeight weight)
    {
        return roundUp(weight.getTons());
    }

    public static IWeight roundUp(double tons)
    {
        return new ImmutableWeight(Math.rint(tons + ROUND_PRECISION));
    }

    // private int round(double value)
    // {
    // return (int) Math.rint(value);
    // }

    // private int roundDown(double value)
    // {
    // return (int) Math.rint(value - ROUND_PRECISION);
    // }
}
